Optimal. Leaf size=91 \[ \frac{\sin ^2(c+d x) \left (a \left (a^2-3 b^2\right ) \cot (c+d x)+b \left (3 a^2-b^2\right )\right )}{2 d}+\frac{1}{2} a x \left (a^2+3 b^2\right )-\frac{b^3 \log (\sin (c+d x))}{d}+\frac{b^3 \log (\tan (c+d x))}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.119388, antiderivative size = 91, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 26, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.231, Rules used = {3088, 1805, 801, 635, 203, 260} \[ \frac{\sin ^2(c+d x) \left (a \left (a^2-3 b^2\right ) \cot (c+d x)+b \left (3 a^2-b^2\right )\right )}{2 d}+\frac{1}{2} a x \left (a^2+3 b^2\right )-\frac{b^3 \log (\sin (c+d x))}{d}+\frac{b^3 \log (\tan (c+d x))}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3088
Rule 1805
Rule 801
Rule 635
Rule 203
Rule 260
Rubi steps
\begin{align*} \int \sec (c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx &=-\frac{\operatorname{Subst}\left (\int \frac{(b+a x)^3}{x \left (1+x^2\right )^2} \, dx,x,\cot (c+d x)\right )}{d}\\ &=\frac{\left (b \left (3 a^2-b^2\right )+a \left (a^2-3 b^2\right ) \cot (c+d x)\right ) \sin ^2(c+d x)}{2 d}+\frac{\operatorname{Subst}\left (\int \frac{-2 b^3-a \left (a^2+3 b^2\right ) x}{x \left (1+x^2\right )} \, dx,x,\cot (c+d x)\right )}{2 d}\\ &=\frac{\left (b \left (3 a^2-b^2\right )+a \left (a^2-3 b^2\right ) \cot (c+d x)\right ) \sin ^2(c+d x)}{2 d}+\frac{\operatorname{Subst}\left (\int \left (-\frac{2 b^3}{x}+\frac{-a^3-3 a b^2+2 b^3 x}{1+x^2}\right ) \, dx,x,\cot (c+d x)\right )}{2 d}\\ &=\frac{b^3 \log (\tan (c+d x))}{d}+\frac{\left (b \left (3 a^2-b^2\right )+a \left (a^2-3 b^2\right ) \cot (c+d x)\right ) \sin ^2(c+d x)}{2 d}+\frac{\operatorname{Subst}\left (\int \frac{-a^3-3 a b^2+2 b^3 x}{1+x^2} \, dx,x,\cot (c+d x)\right )}{2 d}\\ &=\frac{b^3 \log (\tan (c+d x))}{d}+\frac{\left (b \left (3 a^2-b^2\right )+a \left (a^2-3 b^2\right ) \cot (c+d x)\right ) \sin ^2(c+d x)}{2 d}+\frac{b^3 \operatorname{Subst}\left (\int \frac{x}{1+x^2} \, dx,x,\cot (c+d x)\right )}{d}-\frac{\left (a \left (a^2+3 b^2\right )\right ) \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\cot (c+d x)\right )}{2 d}\\ &=\frac{1}{2} a \left (a^2+3 b^2\right ) x-\frac{b^3 \log (\sin (c+d x))}{d}+\frac{b^3 \log (\tan (c+d x))}{d}+\frac{\left (b \left (3 a^2-b^2\right )+a \left (a^2-3 b^2\right ) \cot (c+d x)\right ) \sin ^2(c+d x)}{2 d}\\ \end{align*}
Mathematica [B] time = 0.734223, size = 401, normalized size = 4.41 \[ \frac{a b \left (-2 a^2 b^2+a^4-3 b^4\right ) \sin (2 (c+d x))+\left (-2 a^2 b^4-3 a^4 b^2+b^6\right ) \cos (2 (c+d x))+2 a^2 b^4 \log \left (\sqrt{-b^2}-b \tan (c+d x)\right )+2 a^2 b^4 \log \left (\sqrt{-b^2}+b \tan (c+d x)\right )+4 a^3 \left (-b^2\right )^{3/2} \log \left (\sqrt{-b^2}-b \tan (c+d x)\right )-a^5 \sqrt{-b^2} \log \left (\sqrt{-b^2}-b \tan (c+d x)\right )-4 a^3 \left (-b^2\right )^{3/2} \log \left (\sqrt{-b^2}+b \tan (c+d x)\right )+a^5 \sqrt{-b^2} \log \left (\sqrt{-b^2}+b \tan (c+d x)\right )+2 a^2 b^4+5 a^4 b^2+3 a \sqrt{-b^2} b^4 \log \left (\sqrt{-b^2}+b \tan (c+d x)\right )-3 a \left (-b^2\right )^{5/2} \log \left (\sqrt{-b^2}-b \tan (c+d x)\right )+2 b^6 \log \left (\sqrt{-b^2}-b \tan (c+d x)\right )+2 b^6 \log \left (\sqrt{-b^2}+b \tan (c+d x)\right )-b^6}{4 b d \left (a^2+b^2\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.109, size = 123, normalized size = 1.4 \begin{align*}{\frac{{a}^{3}\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) }{2\,d}}+{\frac{{a}^{3}x}{2}}+{\frac{{a}^{3}c}{2\,d}}-{\frac{3\,{a}^{2}b \left ( \cos \left ( dx+c \right ) \right ) ^{2}}{2\,d}}-{\frac{3\,a{b}^{2}\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) }{2\,d}}+{\frac{3\,a{b}^{2}x}{2}}+{\frac{3\,a{b}^{2}c}{2\,d}}-{\frac{ \left ( \sin \left ( dx+c \right ) \right ) ^{2}{b}^{3}}{2\,d}}-{\frac{{b}^{3}\ln \left ( \cos \left ( dx+c \right ) \right ) }{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.24556, size = 123, normalized size = 1.35 \begin{align*} \frac{6 \, a^{2} b \sin \left (d x + c\right )^{2} +{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} a^{3} + 3 \,{\left (2 \, d x + 2 \, c - \sin \left (2 \, d x + 2 \, c\right )\right )} a b^{2} - 2 \,{\left (\sin \left (d x + c\right )^{2} + \log \left (\sin \left (d x + c\right )^{2} - 1\right )\right )} b^{3}}{4 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.515797, size = 181, normalized size = 1.99 \begin{align*} -\frac{2 \, b^{3} \log \left (-\cos \left (d x + c\right )\right ) -{\left (a^{3} + 3 \, a b^{2}\right )} d x +{\left (3 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )^{2} -{\left (a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right )}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.20132, size = 126, normalized size = 1.38 \begin{align*} \frac{b^{3} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) +{\left (a^{3} + 3 \, a b^{2}\right )}{\left (d x + c\right )} - \frac{b^{3} \tan \left (d x + c\right )^{2} - a^{3} \tan \left (d x + c\right ) + 3 \, a b^{2} \tan \left (d x + c\right ) + 3 \, a^{2} b}{\tan \left (d x + c\right )^{2} + 1}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]